﻿<%@ Page Title="" Language="C#" MasterPageFile="~/CasaShow.Master" AutoEventWireup="true"
  CodeBehind="CadastroShow.aspx.cs" Inherits="CasaShow.CadastroShow" Theme="Theme" %>

<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" runat="server">
  <asp:HiddenField ID="IdArtistaHF" runat="server" />
  <asp:HiddenField ID="IdShowHF" runat="server" />
  <div class="left" style="width: 58%">
  <h2>&nbsp;&nbsp;&nbsp;Show</h2>
    <div class="right">
      <asp:ImageButton ID="SalvarShowBtn" runat="server" BorderColor="#DDDDDD" BorderStyle="Solid"
        BorderWidth="1px" CausesValidation="False" CssClass="icon" EnableViewState="False"
        Visible="false" ImageUrl="~/img/salvar.png" ToolTip="Salvar Artista" OnClick="SalvarShowBtn_Click" />
      <asp:ImageButton ID="NovoShowBtn" runat="server" BorderColor="#DDDDDD" BorderStyle="Solid"
        BorderWidth="1px" CausesValidation="False" CssClass="icon" EnableViewState="False"
        ImageUrl="~/img/show.png" ToolTip="Novo Show" OnClick="NovoShowBtn_Click" />
      <asp:ImageButton ID="VoltarShowBtn" runat="server" BorderColor="#DDDDDD" BorderStyle="Solid"
        BorderWidth="1px" CausesValidation="False" CssClass="icon" EnableViewState="False"
        ImageUrl="~/img/Cancelar.png" ToolTip="Cancelar" OnClick="VoltarShowBtn_Click" />
    </div>
    <br style="clear: both" />
    <br style="clear: both" />
    <asp:GridView ID="ShowGV" runat="server" AllowPaging="True" AllowSorting="False"
      AutoGenerateColumns="False" BorderColor="Silver" BorderStyle="Solid" BorderWidth="1px"
      CssClass="DataGrid" DataKeyNames="ID_SHOW" PageSize="10" Style="position: relative"
      Width="100%" OnPreRender="ShowGV_PreRender" OnRowDataBound="ShowGV_RowDataBound"
      OnPageIndexChanging="ShowGV_PageIndexChanging" 
      onrowediting="ShowGV_RowEditing" onrowdeleting="ShowGV_RowDeleting" >
      <Columns>
        <asp:TemplateField HeaderText="Editar / Exclir">
          <ItemTemplate>
            <asp:ImageButton ID="EditarBtn" runat="server" CommandName="Edit" ImageUrl="~/img/Editar.png"
              Style="position: relative" ToolTip="Editar registro" />&nbsp;&nbsp;&nbsp;
            <asp:ImageButton ID="ExcluirBtn" runat="server" CommandName="Delete" ImageUrl="~/img/Excluir.png"
              Style="position: relative" ToolTip="Excluir registro" OnClientClick='return confirm("Deseja realmente excluir o Artista?");javascript:' />
          </ItemTemplate>
          <ItemStyle HorizontalAlign="center" Width="10%" />
          <HeaderStyle HorizontalAlign="center" CssClass="espacoEsquerdo" Width="10%" />
        </asp:TemplateField>
        <asp:TemplateField HeaderText="Data do show" SortExpression="Label1.Text">
          <ItemTemplate>
            <asp:Label ID="ShowLbl" runat="server" CssClass="espacoEsquerdo" Style="position: relative"
              Text='<%#Eval("DT_SHOW") %>' ></asp:Label>
          </ItemTemplate>
          <HeaderStyle HorizontalAlign="center" Width="20%" />
          <ItemStyle Width="20%" />
        </asp:TemplateField>
        <asp:TemplateField HeaderText="Nome do Artista" SortExpression="Label1.Text">
          <ItemTemplate>
            <asp:Label ID="NomeArtistaLbl" runat="server" CssClass="espacoEsquerdo" Style="position: relative"
              Text='<%#Eval("NM_ARTISTA") %>'></asp:Label>
          </ItemTemplate>
          <HeaderStyle HorizontalAlign="center" Width="20%" />
          <ItemStyle Width="20%" />
        </asp:TemplateField>
        <asp:TemplateField HeaderText="Duração" SortExpression="Label1.Text">
          <ItemTemplate>
            <asp:Label ID="DuracaoLbl" runat="server" CssClass="espacoEsquerdo" Style="position: relative"
              Text='<%#Eval("QT_DURACAO") %>'></asp:Label>
          </ItemTemplate>
          <HeaderStyle HorizontalAlign="center" Width="20%" />
          <ItemStyle Width="20%" />
        </asp:TemplateField>
        <asp:TemplateField HeaderText="Valor" SortExpression="Label1.Text">
          <ItemTemplate>
            <asp:Label ID="ValorLbl" runat="server" CssClass="espacoEsquerdo" Style="position: relative"
              Text='<%#Eval("VL_SHOW") %>'></asp:Label>
          </ItemTemplate>
          <HeaderStyle HorizontalAlign="center" Width="20%" />
          <ItemStyle Width="20%" />
        </asp:TemplateField>
      </Columns>
      <PagerSettings FirstPageImageUrl="~/img/first.gif" FirstPageText="Primeiro" LastPageImageUrl="~/img/last.gif"
        LastPageText="&#218;ltimo" Mode="NextPreviousFirstLast" NextPageImageUrl="~/img/next.gif"
        NextPageText="Pr&#243;ximo" PreviousPageImageUrl="~/img/previous.gif" PreviousPageText="Anterior" />
      <PagerSettings FirstPageImageUrl="~/img/first.gif" FirstPageText="Primeiro" LastPageImageUrl="~/img/last.gif"
        LastPageText="&#218;ltimo" Mode="NextPreviousFirstLast" NextPageImageUrl="~/img/next.gif"
        NextPageText="Pr&#243;ximo" PreviousPageImageUrl="~/img/previous.gif" PreviousPageText="Anterior" />
      <PagerTemplate>
        <asp:Panel ID="PageCounter" runat="server" CssClass="PageCounter" HorizontalAlign="Left">
          Página
          <asp:Label ID="PaginaAtualLbl" runat="server" Text="Label"></asp:Label><br />
          <asp:Label ID="TotalPaginasLbl" runat="server"></asp:Label>
        </asp:Panel>
        <asp:Panel ID="Panel2" runat="server" CssClass="right" HorizontalAlign="Right">
          <asp:ImageButton ID="FirstBtn" runat="server" CommandArgument="First" CommandName="Page"
            ImageUrl="~/img/first.gif" ToolTip="primeira página" />
          <asp:ImageButton ID="PreviousBtn" runat="server" CommandArgument="Prev" CommandName="Page"
            ImageUrl="~/img/previous.gif" ToolTip="página anterior" />
          <asp:ImageButton ID="NextBtn" runat="server" CommandArgument="Next" CommandName="Page"
            ImageUrl="~/img/next.gif" ToolTip="próxima página" />
          <asp:ImageButton ID="LastBtn" runat="server" CommandArgument="Last" CommandName="Page"
            ImageUrl="~/img/last.gif" ToolTip="última página" /></asp:Panel>
      </PagerTemplate>
      <EmptyDataTemplate>
        <asp:Label ID="L" runat="server" CssClass="warning" Text="Nenhum artista encontrado."></asp:Label>
      </EmptyDataTemplate>
    </asp:GridView>
    <br style="clear: both" />
    <br style="clear: both" />
    <asp:DetailsView ID="ShowDV" runat="server" AutoGenerateRows="False" BorderColor="Silver"
      BorderStyle="Solid" BorderWidth="1px" DataKeyNames="ID_SHOW" HeaderText="Cadastro de Show"
      DefaultMode="Edit" HorizontalAlign="Center" Visible="true" Width="100%" 
      ondatabound="ShowDV_DataBound">
      <Fields>
        <asp:TemplateField HeaderText="Data do Show" ItemStyle-Width="350px">
          <EditItemTemplate>
            <asp:TextBox ID="DataShowTxt" runat="server" Style="position: relative" Width="300px"
              Text='<%#Eval("DT_SHOW") %>'></asp:TextBox>
          </EditItemTemplate>
          <InsertItemTemplate>
            <asp:TextBox ID="DataShowTxt" runat="server" Style="position: relative" Width="300px"
              Text=""></asp:TextBox>
          </InsertItemTemplate>
          <ItemStyle CssClass="espacoEsquerdo" />
          <HeaderStyle CssClass="espacoEsquerdo" />
        </asp:TemplateField>
        <asp:TemplateField HeaderText="Nome do Artista" ItemStyle-Width="350px">
          <EditItemTemplate>
            <asp:DropDownList ID="NomeArtistaDdl" runat="server" Style="position: relative" Width="300px" ></asp:DropDownList>
          </EditItemTemplate>
          <InsertItemTemplate>
            <asp:DropDownList ID="NomeArtistaDdl" runat="server" Style="position: relative" Width="300px" ></asp:DropDownList>
          </InsertItemTemplate>
          <ItemStyle CssClass="espacoEsquerdo" />
          <HeaderStyle CssClass="espacoEsquerdo" />
        </asp:TemplateField>
        <asp:TemplateField HeaderText="Duração" ItemStyle-Width="350px">
          <EditItemTemplate>
            <asp:TextBox ID="DuracaoTxt" runat="server" Style="position: relative" Width="300px"
              Text='<%#Eval("QT_DURACAO") %>'></asp:TextBox>
          </EditItemTemplate>
          <InsertItemTemplate>
            <asp:TextBox ID="DuracaoTxt" runat="server" Style="position: relative" Width="300px"
              Text=""></asp:TextBox>
          </InsertItemTemplate>
          <ItemStyle CssClass="espacoEsquerdo" />
          <HeaderStyle CssClass="espacoEsquerdo" />
        </asp:TemplateField>
        <asp:TemplateField HeaderText="Valor" ItemStyle-Width="350px">
          <EditItemTemplate>
            <asp:TextBox ID="ValorTxt" runat="server" Style="position: relative" Width="300px"
              Text='<%#Eval("VL_SHOW") %>'></asp:TextBox>
          </EditItemTemplate>
          <InsertItemTemplate>
            <asp:TextBox ID="ValorTxt" runat="server" Style="position: relative" Width="300px"
              Text=""></asp:TextBox>
          </InsertItemTemplate>
          <ItemStyle CssClass="espacoEsquerdo" />
          <HeaderStyle CssClass="espacoEsquerdo" />
        </asp:TemplateField>
      </Fields>
    </asp:DetailsView>
  </div>
  <div style="width:4%"></div>
  <div class="right" style="width: 38%">
  <h2>&nbsp;&nbsp;&nbsp;Artista</h2>
    <div class="right">
      <asp:ImageButton ID="SalvarBtn" runat="server" BorderColor="#DDDDDD" BorderStyle="Solid"
        BorderWidth="1px" CausesValidation="False" CssClass="icon" EnableViewState="False"
        Visible="false" ImageUrl="~/img/salvar.png" ToolTip="Salvar Artista" OnClick="SalvarBtn_Click" />
      <asp:ImageButton ID="NovoBtn" runat="server" BorderColor="#DDDDDD" BorderStyle="Solid"
        BorderWidth="1px" CausesValidation="False" CssClass="icon" EnableViewState="False"
        ImageUrl="~/img/artista.png" ToolTip="Novo Artista" OnClick="NovoBtn_Click" />
      <asp:ImageButton ID="VoltarBtn" runat="server" BorderColor="#DDDDDD" BorderStyle="Solid"
        BorderWidth="1px" CausesValidation="False" CssClass="icon" EnableViewState="False"
        ImageUrl="~/img/Cancelar.png" ToolTip="Cancelar" OnClick="VoltarBtn_Click" />
    </div>
    <br style="clear: both" />
    <br style="clear: both" />    
  <asp:Label ID="InfoLbl" runat="server" CssClass="warning" Visible="False"></asp:Label>
  <br style="clear: both" />
    <asp:GridView ID="ArtistaGV" runat="server" AllowPaging="True" AllowSorting="False"
      AutoGenerateColumns="False" BorderColor="Silver" BorderStyle="Solid" BorderWidth="1px"
      CssClass="DataGrid" DataKeyNames="ID_ARTISTA" PageSize="10" Style="position: relative"
      Width="100%" OnPreRender="ArtistaGV_PreRender" OnRowDataBound="ArtistaGV_RowDataBound" OnRowEditing="ArtistaGV_RowEditing"
      OnPageIndexChanging="ArtistaGV_PageIndexChanging" OnRowDeleting="ArtistaGV_RowDeleting">
      <Columns>
        <asp:TemplateField HeaderText="Editar / Exclir">
          <ItemTemplate>
            <asp:ImageButton ID="EditarBtn" runat="server" CommandName="Edit" ImageUrl="~/img/Editar.png"
              Style="position: relative" ToolTip="Editar registro" />&nbsp;&nbsp;&nbsp;
            <asp:ImageButton ID="ExcluirBtn" runat="server" CommandName="Delete" ImageUrl="~/img/Excluir.png"
              Style="position: relative" ToolTip="Excluir registro" OnClientClick='return confirm("Deseja realmente excluir o Artista?");javascript:' />
          </ItemTemplate>
          <ItemStyle HorizontalAlign="center" Width="10%" />
          <HeaderStyle HorizontalAlign="center" CssClass="espacoEsquerdo" Width="10%" />
        </asp:TemplateField>
        <asp:TemplateField HeaderText="Nome do Artista" SortExpression="Label1.Text">
          <ItemTemplate>
            <asp:Label ID="NomeLbl" runat="server" CssClass="espacoEsquerdo" Style="position: relative"
              Text='<%#Eval("NM_ARTISTA") %>'></asp:Label>
          </ItemTemplate>
          <HeaderStyle HorizontalAlign="center" Width="20%" />
          <ItemStyle Width="20%" />
        </asp:TemplateField>
      </Columns>
      <PagerSettings FirstPageImageUrl="~/img/first.gif" FirstPageText="Primeiro" LastPageImageUrl="~/img/last.gif"
        LastPageText="&#218;ltimo" Mode="NextPreviousFirstLast" NextPageImageUrl="~/img/next.gif"
        NextPageText="Pr&#243;ximo" PreviousPageImageUrl="~/img/previous.gif" PreviousPageText="Anterior" />
      <PagerSettings FirstPageImageUrl="~/img/first.gif" FirstPageText="Primeiro" LastPageImageUrl="~/img/last.gif"
        LastPageText="&#218;ltimo" Mode="NextPreviousFirstLast" NextPageImageUrl="~/img/next.gif"
        NextPageText="Pr&#243;ximo" PreviousPageImageUrl="~/img/previous.gif" PreviousPageText="Anterior" />
      <PagerTemplate>
        <asp:Panel ID="PageCounter" runat="server" CssClass="PageCounter" HorizontalAlign="Left">
          Página
          <asp:Label ID="PaginaAtualLbl" runat="server" Text="Label"></asp:Label><br />
          <asp:Label ID="TotalPaginasLbl" runat="server"></asp:Label>
        </asp:Panel>
        <asp:Panel ID="Panel2" runat="server" CssClass="right" HorizontalAlign="Right">
          <asp:ImageButton ID="FirstBtn" runat="server" CommandArgument="First" CommandName="Page"
            ImageUrl="~/img/first.gif" ToolTip="primeira página" />
          <asp:ImageButton ID="PreviousBtn" runat="server" CommandArgument="Prev" CommandName="Page"
            ImageUrl="~/img/previous.gif" ToolTip="página anterior" />
          <asp:ImageButton ID="NextBtn" runat="server" CommandArgument="Next" CommandName="Page"
            ImageUrl="~/img/next.gif" ToolTip="próxima página" />
          <asp:ImageButton ID="LastBtn" runat="server" CommandArgument="Last" CommandName="Page"
            ImageUrl="~/img/last.gif" ToolTip="última página" /></asp:Panel>
      </PagerTemplate>
      <EmptyDataTemplate>
        <asp:Label ID="L" runat="server" CssClass="warning" Text="Nenhum artista encontrado."></asp:Label>
      </EmptyDataTemplate>
    </asp:GridView>
    <br style="clear: both" />
    <br style="clear: both" />
    <asp:DetailsView ID="ArtistaDV" runat="server" AutoGenerateRows="False" BorderColor="Silver"
      BorderStyle="Solid" BorderWidth="1px" DataKeyNames="ID_ARTISTA" HeaderText="Cadastro de Artista"
      DefaultMode="Edit" HorizontalAlign="Center" Visible="true" Width="100%">
      <Fields>
        <asp:TemplateField HeaderText="Nome" ItemStyle-Width="100%">
          <EditItemTemplate>
            <asp:TextBox ID="NomeArtistaTxt" runat="server" Style="position: relative" Width="250px"
              Text='<%#Eval("NM_ARTISTA") %>'></asp:TextBox>
          </EditItemTemplate>
          <InsertItemTemplate>
            <asp:TextBox ID="NomeArtistaTxt" runat="server" Style="position: relative" Width="250px"
              Text=""></asp:TextBox>
          </InsertItemTemplate>
          <ItemStyle CssClass="espacoEsquerdo" />
          <HeaderStyle CssClass="espacoEsquerdo" />
        </asp:TemplateField>
      </Fields>
    </asp:DetailsView>
  </div>
  <br style="clear: both" />
</asp:Content>
